﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class BG_Manage_BG_NewsType : System.Web.UI.Page
{
    VPINews.BLL.NewsType bll_type = new VPINews.BLL.NewsType();
    VPINews.Model.NewsType mod_type = new VPINews.Model.NewsType();

    protected void Page_Load(object sender, EventArgs e)
    {
         if (!Page.IsPostBack)
        {
            getType();
        }
    }

    protected void getType()
    {
        GridView1.DataSource = bll_type.GetAllList();
        GridView1.DataBind();
    }


    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        GridView1.DataSource = bll_type.GetAllList();
        GridView1.DataBind();
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "DeleteType")
        {
            bll_type.Delete(Convert.ToString(e.CommandArgument));
            getType();


        }

    }
}
